Skip to content

feat(lexers): add Hurl lexer - #1298

Merged
alecthomas merged 1 commit into
alecthomas:masterfrom
cc1a2b:feat/hurl-lexer
Jul 2, 2026
Merged

feat(lexers): add Hurl lexer#1298
alecthomas merged 1 commit into
alecthomas:masterfrom
cc1a2b:feat/hurl-lexer

Conversation

@cc1a2b

@cc1a2b cc1a2b commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hurl lexer

Adds a lexer for Hurl — the plain-text HTTP/API testing format (*.hurl). Today these files fall back to plaintext, but there's a lot worth colouring.

Handles:

  • request methods (GET, POST, DELETE, ...) and the URL that follows
  • the HTTP <status> response line
  • [Sections][Asserts], [Captures], [Options], [QueryStringParams], [FormParams], [MultipartFormData], [Cookies], [BasicAuth]
  • the query / predicate / filter DSL used in asserts & captures (jsonpath, header, contains, matches, isIsoDate, count, split, ...)
  • {{templates}} (in URLs, strings and bodies)
  • "quoted" and ```triple-quoted``` bodies, numbers, booleans and comments

Includes testdata/hurl.actual + hurl.expected; go test ./... passes, and Hurl is added to the README language list.

Hurl (https://hurl.dev) is a plain-text HTTP/API testing format. Its files
are full of things worth colouring — request methods, URLs, `[Sections]`,
`{{templates}}`, and the query/predicate/filter DSL in asserts and captures —
so a dedicated lexer beats the plaintext fallback.

Highlights methods, URLs (with templates), the `HTTP` status line, sections,
queries (jsonpath/xpath/header/...), predicates, filters, `{{...}}` templates,
quoted and ```triple-quoted``` bodies, numbers and booleans.
@alecthomas
alecthomas merged commit deca444 into alecthomas:master Jul 2, 2026
2 checks passed
@alecthomas

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants